﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CLUBsInterpreter.ObjectTypes
{
	/**
	 * <summary>
	 * Describes a turn object in the CLUBs environment.
	 * </summary>
	 **/
	class CLUBsTurn : CLUBsObject
	{
		/**
		 * <summary>
		 * Default constructor creates empty turn with default properties.
		 * </summary>
		 **/
		public CLUBsTurn()
		{
			// Set the object identifier type
			ObjectIdentifierType = AST.IdentifierType.Turn;
			// SPECIFY STANDARD ENVIRONMENT
			// No standard variables yet
		}

		/**
		 * <see cref="CLUBsObject.CopyValueFromObject"/>
		 **/
		public override void CopyValueFromObject(CLUBsObject obj)
		{
            CLUBsTurn turnObj = (CLUBsTurn)obj;
            LocalVariables.Clear();
            foreach(KeyValuePair<string, CLUBsObject> var in turnObj.LocalVariables)
            {
				LocalVariables.Add(var.Key, var.Value);
				LocalVariables[var.Key].CopyValueFromObject(var.Value);
            }
		}
	}
}
